package com.atguigu.edu.realtime.publisher.controller;

import com.atguigu.edu.realtime.publisher.bean.VideoPlayCnt;
import com.atguigu.edu.realtime.publisher.service.VideoPlayChapterCountService;
import com.atguigu.edu.realtime.publisher.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@RequestMapping
public class VideoPlayChapterCountController {
    @Autowired
    VideoPlayChapterCountService videoPlayChapterCountService;

    @RequestMapping("/videoplay")
    public String getVideoPlayCnt(@RequestParam(value = "date", defaultValue = "1")Integer date){
        if(date == null){
            DateUtil.now();
        }
        List<VideoPlayCnt> videoPlayCnt = videoPlayChapterCountService.getVideoPlayCnt(date);
        return "";
    }
}
